﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<mediatheque.Areas.Admin.Models.Oeuvres>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Index
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.RenderPartial("../Layout/admin_menu"); %>
    <ul class="breadcrumb">
        <li class="active"><a href="/Admin/Categories">Les catégories</a> <span class="divider">&raquo;</span></li>
    </ul>
    <h2>Catégories de film</h2>
    <form class="form-inline" method="post" action="/Admin/Categories">
        <div class="control-group">
            <div class="controls">
                <input type="text" name="libelle" placeholder="Categorie" />
                <button type="submit" name="add_categorie" class="btn btn-primary btn-small"><i class="icon-plus icon-white"></i> Ajouter</button>
            </div>
        </div>
    </form>
    <% if (Model.getCategories().Count == 0) {%>
    <div class="alert alert-info">Aucune catégorie enregistrée pour le moment</div>
    <% } else {%>
    <table class="table table-bordered table-striped">
        <thead>
            <tr>
                <th>#ID</th>
                <th>Categorie</th>
            </tr>
        </thead>
    <%
           foreach (var item in Model.getCategories())
           {%>
           <tr>
            <td><%= item.id %></td>
            <td><%= item.lib %></td>
            <td><a href="/Admin/Categories/Delete/<%= item.id %>" class="btn btn-danger btn-mini"><i class="icon-remove icon-white"></i></a></td>
           </tr>
    <% } %>
    </table>
    <%
       } %>
</asp:Content>
